package com.fcml.pattern.factory.simple;

/**
 * @author fcml
 * @date 2018/11/2
 *
 * 在需要实例化创建对象的时候，注入工厂对象，调用工厂方法，生产CountPrice对象。
 */
public class App {

    public static void main(String[] args) {
        double totalAmount = 20000D;
        CountPriceFactory factory = new CountPriceFactory();
        CountPrice countPrice = factory.createCalPrice(totalAmount);
        System.out.println(countPrice.countPrice(totalAmount));
    }
}
